class Logger:    
    def __init__(self):
        self.clear()
        
    def addMessage(self, description, sql, results):
        #print description, "|", sql, "|", results
        #print sql
        self.messages.append(Message(description, sql, results));

    def getMessage(self, i):
        return self.messages[i];

    def getNumMessages(self):
        return len(self.messages);

    def setFinalAnswer(self, ans):
        self.finalAnswer = ans;

    def getFinalAnswer(self):
        return self.finalAnswer;

    def clear(self):
        self.messages = []
        self.finalAnswer = ""

class Message:
    def __init__(self, description, sql, results):
        self.description = description;
        self.sql = sql;
        self.results = results;
